<template>
  <div class="dashboard-container">
    <el-row>
      <el-col :span="24">
        <div class="grid-content bg-purple-dark" >
          <el-select v-model="value" placeholder="请选择" size="medium" class="select1" style="width:30%;">
          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" :disabled="item.disabled"></el-option>
          </el-select>
          <el-button type="primary" icon="el-icon-search" style="margin-left:20px;">查询</el-button>
        </div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="6">
        <div class="card-panel" @click="handleSetLineChartData('newVisitis')">
          <div class="card-panel-icon-wrapper icon-people">
            <svg-icon icon-class="table" class-name="card-panel-icon" />
          </div>
          <div class="card-panel-description">
            <div class="card-panel-text">
              总出水温度(℃)
            </div>
            <span class="card-panel-num" >69 ℃</span>
          </div>
        </div>
        <div class="card-panel" @click="handleSetLineChartData('messages')">
          <div class="card-panel-icon-wrapper icon-message">
            <svg-icon icon-class="example" class-name="card-panel-icon" />
          </div>
          <div class="card-panel-description">
            <div class="card-panel-text">
              总回水温度(℃)
            </div>
            <span class="card-panel-num" >33 ℃</span>
          </div>
        </div>
        <div class="card-panel" @click="handleSetLineChartData('purchases')">
          <div class="card-panel-icon-wrapper icon-money">
            <svg-icon icon-class="nested" class-name="card-panel-icon" />
          </div>
          <div class="card-panel-description">
            <div class="card-panel-text">
              室外地源井温度(℃)
            </div>
            <span class="card-panel-num" >23 ℃</span>
          </div>
        </div>
        <div class="card-panel" @click="handleSetLineChartData('shoppings')">
          <div class="card-panel-icon-wrapper icon-shopping">
            <svg-icon icon-class="eye" class-name="card-panel-icon" />
          </div>
          <div class="card-panel-description">
            <div class="card-panel-text">
              室外温度(℃)
            </div>
            <span class="card-panel-num" >12 ℃</span>
          </div>
        </div>
      </el-col>
     
      <el-col :span="6">
        <div class="card-panel" @click="handleSetLineChartData('newVisitis')">
          <div class="card-panel-icon-wrapper icon-people">
            <svg-icon icon-class="table" class-name="card-panel-icon" />
          </div>
          <div class="card-panel-description">
            <div class="card-panel-text">
              当天的累积供能量(kW·h)
            </div>
            <span class="card-panel-num" >300 kW·h</span>
          </div>
        </div>
        <div class="card-panel" @click="handleSetLineChartData('messages')">
          <div class="card-panel-icon-wrapper icon-message">
            <svg-icon icon-class="example" class-name="card-panel-icon" />
          </div>
          <div class="card-panel-description">
            <div class="card-panel-text">
              当天的累积蓄能量(kW·h)
            </div>
            <span class="card-panel-num" >23,823 kW·h</span>
          </div>
        </div>
        <div class="card-panel" @click="handleSetLineChartData('purchases')">
          <div class="card-panel-icon-wrapper icon-money">
            <svg-icon icon-class="nested" class-name="card-panel-icon" />
          </div>
          <div class="card-panel-description">
            <div class="card-panel-text">
              蓄能释放百分比(%)
            </div>
            <span class="card-panel-num" >45 %</span>
          </div>
        </div>
        <div class="card-panel" @click="handleSetLineChartData('shoppings')">
          <div class="card-panel-icon-wrapper icon-shopping">
            <svg-icon icon-class="eye" class-name="card-panel-icon" />
          </div>
          <div class="card-panel-description">
            <div class="card-panel-text">
              室外湿度(℃)
            </div>
            <span class="card-panel-num" >23 ℃</span>
          </div>
        </div>
      </el-col>
       <el-col :span="12">
        <div class="grid-content bg-purple-light1"><map-chart /></div>
      </el-col>
    </el-row>

    <el-row>
       <el-col :span="12" class="chart-bg">
         <div class="grid-content bg-purple-light2">
         <div class="chart-title"><div class="el-icon-caret-right"></div>
          实时的能耗数据
          </div>
          
         <line-chart />
         </div>
       </el-col>
       <el-col :span="6">
          <el-card class="box-card" style="height:320px;">
            <div slot="header" class="clearfix">
              <span>设备总览</span>
              
            </div>
            <div class="text item">
              <div class="chart-title">开启个数(个)：</div>
              <el-progress :percentage="100" :format="format"></el-progress>
              <el-divider></el-divider>
              <div class="chart-title">开启个数(个)：</div>
              <el-progress :percentage="50" :format="format"></el-progress>
              <el-divider></el-divider>
              <div class="chart-title">开机比例(%)：</div>
              <el-progress :percentage="50"></el-progress>
            </div>
          </el-card>
          
       </el-col>

       <el-col :span="6">
         <el-card class="box-card" style="height:320px;margin-left:4px;">
            <div slot="header" class="clearfix">
              <span>设备故障率</span>
              
            </div>
            <div class="text item">
              <div class="chart-title">设备故障个数(个)：</div>
              <el-progress :percentage="50" :format="format"></el-progress>
              <el-divider></el-divider>
              <div class="chart-title">设备总个数(个)：</div>
              <el-progress :percentage="100" :format="format"></el-progress>
              <el-divider></el-divider>
              <div class="chart-title">设备故障率(%)：</div>
              <el-progress :percentage="50"></el-progress>
            </div>
          </el-card>
       </el-col>
       
    </el-row>

  </div>
  
</template>

<script>
import { mapGetters } from 'vuex'
import LineChart from './components/LineChart'
import MapChart from './components/MapChart'

export default {
  name: 'EnergySupplyOverview',
  components: {
    MapChart,
    LineChart
  },
      data() {
      return {
        options: [{
          value: 'enery1',
          label: '第一号能源站',
          
        }, {
          value: 'enery2',
          label: '第二号能源站'
        }, {
          value: 'enery3',
          label: '第三号能源站'
        }, {
          value: 'enery4',
          label: '第四号能源站'
        }, {
          value: 'enery5',
          label: '第五号能源站'
        }],
        value: ''
      }
    },methods: {
      format(percentage) {
        return percentage = `${percentage}个`;
      }
    }

  
}

</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }

}
 .el-row {    
    margin-bottom: 5px;
    &:last-child {
      margin-bottom: 1;
    }
  }
  .el-col {
    border-radius: 4px;
  }
 
  .bg-purple {
    height: 100px;
    background: #d3dce6;
    margin: 5px;
  }
   .bg-purple2 {
    height: 130px;
    background: #d3dce6;
    margin: 5px;
  }
  .bg-purple-light1 {
    background: #e5e9f2;
    height: 432px;
    margin: 5px;
  }
  .bg-purple-light2 {    
    height: 328px;
    margin: 5px;
  }
  .grid-content {
    border-radius: 4px;
    min-height: 36px;
  }
  .row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
  }
 .card-panel {
    height: 108px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    border-style:solid; 
    border-color: black;
    border-width: 3px;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);

    &:hover {
      .card-panel-icon-wrapper {
        color: #fff;
      }

      .icon-people {
        background: #40c9c6;
      }

      .icon-message {
        background: #36a3f7;
      }

      .icon-money {
        background: #f4516c;
      }

      .icon-shopping {
        background: #34bfa3
      }
    }

    .icon-people {
      color: #40c9c6;
    }

    .icon-message {
      color: #36a3f7;
    }

    .icon-money {
      color: #f4516c;
    }

    .icon-shopping {
      color: #34bfa3
    }

    .card-panel-icon-wrapper {
      float: left;
      margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }

    .card-panel-icon {
      float: left;
      font-size: 48px;
    }

    .card-panel-description {
      float: right;
      font-weight: bold;
      margin: 26px;
      margin-left: 0px;
      text-align: right;

      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 14px;
        margin-bottom: 12px;
      }
      .card-panel-text1 {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 11px;
        margin-bottom: 12px;
      }

      .card-panel-num {
        font-size: 20px;        
      }
    }
  }
  .chart-bg{
    color: #666;
    background: #fff;
    border-style:solid; 
    border-color: black;
    border-width: 3px;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);
  }
   .chart-title{
    height: 25px;
    line-height: 25px;
    font-size: 18px;
    border-bottom: 1px #efefef solid;

  }
  .chart-content{
    height: calc(100% - 25px);
  }
</style>
